package com.cskaoyan.converter;

import com.cskaoyan.bean.Category;
import com.cskaoyan.bean.wx_vo.catalog.BaseWxCatalogVO;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

/**
 * @description：
 * @author: 曹旭
 * @date: 2022/5/10 07:35
 */
@Component
public class WxCatalogPOJO2VOConverter implements Converter<Category, BaseWxCatalogVO> {
    @Override
    public BaseWxCatalogVO convert(Category source) {
        BaseWxCatalogVO baseWxCatalogVO = BaseWxCatalogVO.builder().addTime(source.getAddTime())
                .deleted(source.getDeleted()).desc(source.getDesc()).iconUrl(source.getIconUrl())
                .id(source.getId()).keywords(source.getKeywords()).level(source.getLevel())
                .name(source.getName()).picUrl(source.getPicUrl()).pid(source.getPid()).build();
        return baseWxCatalogVO;
    }
}
